<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>学生信息列表</title>
    <style>
        table {
            width: 100%;
            border-collapse: collapse;
        }
        th, td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: center;
        }
        th {
            background-color: #f2f2f2;
        }
        button {
            padding: 5px 10px;
            margin: 2px;
        }
    </style>
</head>
<body>

<h2>学生信息列表</h2>
<table>
    <thead>
        <tr>
            <th>编号</th>
            <th>姓名</th>
            <th>性别</th>
            <th>年龄</th>
            <th>籍贯</th>
            <th>班级</th>
            <th>联系电话</th>
            <th>操作</th>
        </tr>
        {% for student in students %}
        <tr>
            <td>{{ student.sno }}</td>
            <td>{{ student.sname }}</td>
            <td>{{ student.ssex }}</td>
            <td>{{ student.sage }}</td>
            <td>{{ student.dno }}</td>
            <td>{{ student.sclass }}</td>
            <td>{{ student.address }}</td>
            <td>
                <a href="{{ url_for('edit_student', sno=student.sno) }}">修改</a>
                <form action="{{ url_for('delete_student', sno=student.sno) }}" method="post">
                    <button type="submit">删除</button>
                </form>
            </td>
        </tr>
        {% endfor %}
    </thead>
</table>
<a href="{{ url_for('add_student') }}">添加</a>
</body>
</html>